
//注册窗口_注册按钮监视器
import java.awt.event.*;
import javax.swing.*;
public class Client_zc_button1 implements ActionListener{
    Client_zc win;
    Client_zc_button1(Client_zc win){
        this.win = win;
    }
    public void actionPerformed(ActionEvent e) {
        String s1 = win.text1.getText();
        String s2 = win.text2.getText();
        String s3 = win.text3.getText();
        if(s1.equals("")||s2.equals("")) {
            JOptionPane.showMessageDialog(null, "账号和密码不能为空");
        }else {
            if(s2.equals(s3)) {
                String mess = null;
                try {
                    Client_Socket.out.writeUTF("我要注册");
                    Thread.sleep(1000);
                    Client_Socket.out.writeUTF(s1);
                    Client_Socket.out.writeUTF(s2);
                    mess = Client_Socket.in.readUTF();
                }catch(Exception e1) {}
                JOptionPane.showMessageDialog(null, mess); 
            }else {
                JOptionPane.showMessageDialog(null, "两次输入的密码不一致!"); 
            }
        }
    }
}